package com.chexiehui.jc.ui.fragment;

import android.annotation.SuppressLint;
import android.os.Bundle;

import com.chexiehui.jc.R;
import com.chexiehui.jc.base.BaseFragment;
import com.chexiehui.jc.widget.NoTouchAutoHeightViewPager;

public class TempAuthHeightFragment extends BaseFragment {

    public static TempAuthHeightFragment getInstance(int position) {
        TempAuthHeightFragment fragment = new TempAuthHeightFragment();
        Bundle bundle = new Bundle();
        bundle.putInt("position", position);
        fragment.setArguments(bundle);
        return fragment;
    }
    private NoTouchAutoHeightViewPager viewPager;
    private int position;

    @Override
    protected void beforeSetView(){
        Bundle bundle = getArguments();
        if(bundle != null){
            position = bundle.getInt("position");
        }
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        if(viewPager != null){
            viewPager.setObjectForPosition(getRootView(), position);
        }
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_temp;
    }

    public void setViewPager(NoTouchAutoHeightViewPager viewPager) {
        this.viewPager = viewPager;
    }
}
